﻿
@{
    ViewBag.Title = "Form";
    
}

<div class="col-md-12">
    <div ng-controller="DictionaryController">
        <!-- BEGIN  HEADER-->
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="/">主页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">数据字典</a>
                </li>
            </ul>
        </div>
        <!-- END  HEADER-->
        <!--BEGIN Form -->
        <div>
            <div class="portlet light">
                <div class="portlet-title">
                    <div class="caption font-green-haze">
                        <i class="icon-settings font-green-haze"></i>
                        <span class="caption-subject bold uppercase">{{formTile}}</span>
                    </div>
                    <div class="actions">
                        <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title="全屏"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <div id="bootstrap_alerts_demo"></div>
                    <form role="form" class="form-horizontal" name="serverForm" novalidate>
                        <div class="form-body">
                            <div class="form-group form-md-line-input">
                                <label class="col-md-2 control-label" for="form_control_1">字典名称</label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" id="form_control_1" ng-model="model.Name" placeholder="请输入字典名称" required>
                                    <div class="form-control-focus">
                                    </div>
                                    <span class="help-block">字典名称是必填</span>
                                </div>
                            </div>
                            <div class="form-group form-md-line-input">
                                <label class="col-md-2 control-label" for="form_control_1">字典值</label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" id="form_control_1" ng-model="model.Value"  >
                                    <div class="form-control-focus">
                                    </div>
                                </div>

                            </div>

                            <div class="form-group form-md-line-input">
                                <label class="col-md-2 control-label" for="form_control_1">父级</label>
                                <div class="col-md-10">
                                    <select class="form-control" id="form_control_1" ng-model="model.ParentId">
                                        <option ng-repeat="parent in ParentList" value="{{parent.Id}}" ng-selected="parent.Id == model.ParentId">{{parent.Name}}</option>
                                    </select>
                                    <div class="form-control-focus">
                                    </div>
                                    
                                </div>
                            </div>

                            <div class="form-group form-md-line-input">
                                <label class="col-md-2 control-label" for="form_control_1">描述</label>
                                <div class="col-md-10">
                                    <textarea class="form-control" rows="3" ng-model="model.Description"></textarea>
                                    <div class="form-control-focus">
                                    </div>

                                </div>
                            </div>

                        </div>
                        <div class="form-actions">
                            <div class="row">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" class="btn blue btn-lg" ng-disabled="serverForm.$invalid" ng-click="SubmitFrom(model)">提交</button>
                                    <a type="button" class="btn default btn-lg" href="@Url.Action("Index","Dictionary")">取消</a>
                                </div>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
        <!--END Form -->
        <input  type="hidden" id="id" value="@Html.ViewContext.RouteData.Values["id"]"/>
    </div>
</div>
@section Scripts {
    <script src="~/app/controllers/dictionaryForm.js"></script>
}
